import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 项目采购信息信息 */
export interface ProjectProcurementInformation {
          id: number; // 信息id
          titleType?: number; // 标题类型
          title?: string; // 标题
          industry?: string; // 行业
          area?: string; // 地区
          publicationTime?: string | Dayjs; // 公布时间
          details?: string; // 正文
  }

// 项目采购信息 API
export const ProjectProcurementInformationApi = {
  // 查询项目采购信息分页
  getProjectProcurementInformationPage: async (params: any) => {
    return await request.get({ url: `/biz/project-procurement-information/page`, params })
  },

  // 查询项目采购信息详情
  getProjectProcurementInformation: async (id: number) => {
    return await request.get({ url: `/biz/project-procurement-information/get?id=` + id })
  },

  // 新增项目采购信息
  createProjectProcurementInformation: async (data: ProjectProcurementInformation) => {
    return await request.post({ url: `/biz/project-procurement-information/create`, data })
  },

  // 修改项目采购信息
  updateProjectProcurementInformation: async (data: ProjectProcurementInformation) => {
    return await request.put({ url: `/biz/project-procurement-information/update`, data })
  },

  // 删除项目采购信息
  deleteProjectProcurementInformation: async (id: number) => {
    return await request.delete({ url: `/biz/project-procurement-information/delete?id=` + id })
  },

  /** 批量删除项目采购信息 */
  deleteProjectProcurementInformationList: async (ids: number[]) => {
    return await request.delete({ url: `/biz/project-procurement-information/delete-list?ids=${ids.join(',')}` })
  },

  // 导出项目采购信息 Excel
  exportProjectProcurementInformation: async (params) => {
    return await request.download({ url: `/biz/project-procurement-information/export-excel`, params })
  },
}